<?php

namespace App\Models\Game\Flying;

use App\Models\MainDB\Gift;
use App\Models\MainDB\UserData;
use Illuminate\Database\Eloquent\Model;

class FlyingLog extends Model{

    protected $connection = 'mysql_flying';

    protected $table = 'flying_gift_log';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名

    protected $fillable = [
        "id",
        "user_id",
        "gift_id",
        "add_time",
        "number",
    ];

    public $timestamps = false;

    public function user_data()
    {
        return $this->belongsTo(UserData::class, 'user_id', 'user_id');
    }

    public function gift()
    {
        return $this->belongsTo(Gift::class, 'gift_id', 'id');
    }
}
